package com.cskaoyan.converter;

import com.cskaoyan.bean.pojo.Goods;
import com.cskaoyan.bean.vo.GoodsCategoryVO;
import com.cskaoyan.bean.vo.WxGoodsListVO;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: thz
 * @class: GoodsConverter
 */
public class GoodsConverter {

    public static List<WxGoodsListVO.GoodsListBean> convertToGoodsListBean(List<Goods> goodsList){
        ArrayList<WxGoodsListVO.GoodsListBean> goodsListBeans = new ArrayList<>();
        for (Goods goods : goodsList) {
            WxGoodsListVO.GoodsListBean goodsListBean = new WxGoodsListVO.GoodsListBean();
            goodsListBean.setId(goods.getId());
            goodsListBean.setName(goods.getName());
            goodsListBean.setBrief(goods.getBrief());
            goodsListBean.setPicUrl(goods.getPicUrl());
            goodsListBean.setCounterPrice(goods.getCounterPrice());
            goodsListBean.setRetailPrice(goods.getRetailPrice());
            goodsListBeans.add(goodsListBean);
        }
        return goodsListBeans;
    }

}
